package service

import (
	"context"
	"user-service/basic/config"
	__ "user-service/basic/proto"
	"user-service/handler/model"
)

func (s *Server) MedicalRecord(_ context.Context, in *__.MedicalRecordReq) (*__.MedicalRecordResp, error) {
	record := model.MedicalRecord{
		UserId:     in.UserId,
		RecordName: in.RecordName,
		Desc:       in.Desc,
		Result:     in.Result,
		DockerId:   in.DockerId,
	}
	config.DB.Create(&record)
	return &__.MedicalRecordResp{
		MedicalRecordid: int64(record.ID),
	}, nil
}
